<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/page" prefix="public"%>
<public:pageControl classPath="app.portalbs.basic.user.DeptTree" />

<script language="javascript">
	
	function deptTree_onclick(tree,page){
		 
		 if(!tree.treeNode.isParent){			 
			 page.find("deptTreeFrame").view.url = "oper/operList.jsp?deptid="+tree.treeNode.nodeID;		 
		 }else{			 
			 page.find("deptTreeFrame").view.url = "";			 
		 }
		 
	 }
	
	function deptTree_show(tree,page,type){
		 
		 if(type == "add"){	 
			 return true;	 
		 }
		 
		 else if(type == "edit"){
			 if(tree.treeNode.level == 0 ){
				 return false;
			 }else{
				 return true;
			 }
		 }
		 
		 else if(type == "delete"){
			 if(tree.treeNode.isParent){
				 return false;
			 }else{
				 return true;
			 }
		 }
		 
		 else{			 
			 return true;		 
		 }
		 
	}
	
	function deptTree_page(tree,page){
		 return {
			url : "deptEdit.jsp",
		    width : "50%"
		 };
	}
</script>

